package com.javaweb.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Room {
    private Integer id;//主键ID
    @NotEmpty
    @Pattern(regexp = "^\\S{2,10}$")
    private String roomName;//房间名
    @Pattern(regexp = "^\\S{0,32}$")
    private String intro;//介绍
    private Integer creatorId;//创建者id
    private String creatorName;//创建者名称
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;//创建时间
    private Integer userNum; //在线人数
}
